[XEND] Make sure UUID is in the right format.
authorAlastair Tse <atse@xensource.com>
Fri, 8 Dec 2006 13:28:22 +0000 (13:28 +0000)
committerAlastair Tse <atse@xensource.com>
Fri, 8 Dec 2006 13:28:22 +0000 (13:28 +0000)
Signed-off-by: Alastair Tse <atse@xensource.com>
tools/python/xen/xend/XendConfig.py

index 9896254f32cbdde5ab94ae14e3aaee3c1b395159..af2971a870d305009feabf52f22cefd55a192ade 100644 (file)
@@ -390,11 +390,16 @@ class XendConfig(dict):
         if self.get('vcpus_number') != None:
             self['vcpu_avail'] = (1 << self['vcpus_number']) - 1
 
+    def _uuid_sanity_check(self):
+        """Make sure UUID is in proper string format with hyphens."""
+        self['uuid'] = uuid.toString(uuid.fromString(self['uuid']))
+
     def validate(self):
         self._memory_sanity_check()
         self._actions_sanity_check()
         self._builder_sanity_check()
         self._vcpus_sanity_check()
+        self._uuid_sanity_check()
 
     def _dominfo_to_xapi(self, dominfo):
         self['domid'] = dominfo['domid']